import uuid

from rest_framework.serializers import ModelSerializer
from rest_framework import serializers
from common.models import *


class UserSerializers(serializers.ModelSerializer):
    class Meta:
        model = TbMiniappUser
        depth = 1
        fields = "__all__"
        # exclude = ["password"]


class UserInfoSerializers(serializers.ModelSerializer):
    class Meta:
        model = TbMiniappUser
        depth = 1
        exclude = ["password", "mini_openid"]

    def get_teacher(self, obj):
        return obj.uid


class BasicTableSerializers(serializers.ModelSerializer):
    class Meta:
        model = TbBasicTable
        fields = "__all__"
